package com.ktwlsoft.archivemanage.domain.dao.entity;

import com.ktwlsoft.archivemanage.service.utils.SnowFlake;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 实体基类
 *
 * @version 0.1
 */
@Getter
@Setter
public abstract class BaseEntity {

    /**
     * id
     */
    private Long id = SnowFlake.getNextId();

    /**
     * 创建时间
     */
    private Date createdAt = new Date();

    /**
     * 更新时间
     */
    private Date updateAt = new Date();

    /**
     * 创建人
     */
    private String creator = null;

    /**
     * 创建人id
     */
    private Long creatorId = null;

    public void update(BaseEntity entity) {
        this.updateAt = new Date();
    }
}
